home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7703 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Need help with strings
  5. Date: 25 Feb 1996 10:56:43 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4gpf9b$r7g@news1.usa.pipeline.com>
  8. References: <312fa506.21210161@news.ucla.edu>
  9. NNTP-Posting-Host: pipe14.h1.usa.pipeline.com
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete)
  13. X-Newsreader: Pipeline USA v3.3.0
  14.  
  15. On Feb 24, 1996 23:55:08 in article <Re: Need help with strings>,
  16. 'philhong@ucla.edu (Phil Hong)' wrote: 
  17.  
  18.  
  19. >OK, I just figured out what I did.  I had a constructor which was 
  20. >setting all the pointers to equal 0.  I thought that this would 
  21. >initialize them to point to null but apparently it won't let me assign 
  22. >anything to the variable later. 
  23.  
  24. Phil:  I'm afraid you've figured it wrong -- or you're not saying what 
  25. you mean -- or I misunderstand.   
  26.  
  27. First, initializing pointers to 0 does make them to point to what  
  28. most programmers consider NULL. 
  29.  
  30. Second, initializing variables to anything, including 0, does not 
  31. preclude you from assigning to those variables later.  It does, 
  32. however, mean that you can't strcpy to/from those variables 
  33. until they have been rebound to point to some valid memory 
  34. block.  But that's different. 
  35.  
  36. -- 
  37. Pete Grant 
  38. Kalevi, Inc. 
  39. Software Engineering & development
  40.